<% layout('/layouts/default.html', {title: '消息推送表管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('消息推送表管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('zx:sys:msg:push:zxMsgPush:edit')){ %>
					<a href="${ctx}/zx/sys/msg/push/zxMsgPush/form" class="btn btn-default btnTool" title="${text('新增消息推送表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${zxMsgPush}" action="${ctx}/zx/sys/msg/push/zxMsgPush/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('消息类型')}：</label>
					<div class="control-inline">
						<#form:input path="msgType" maxlength="16" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('消息标题')}：</label>
					<div class="control-inline">
						<#form:input path="msgTitle" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('消息内容')}：</label>
					<div class="control-inline">
						<#form:input path="msgContent" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('业务主键')}：</label>
					<div class="control-inline">
						<#form:input path="bizKey" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('业务类型')}：</label>
					<div class="control-inline">
						<#form:input path="bizType" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('接受者账号')}：</label>
					<div class="control-inline">
						<#form:input path="receiveCode" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('接受者用户编码')}：</label>
					<div class="control-inline">
						<#form:input path="receiveUserCode" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('接受者用户姓名')}：</label>
					<div class="control-inline">
						<#form:input path="receiveUserName" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('发送者用户编码')}：</label>
					<div class="control-inline">
						<#form:input path="sendUserCode" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('发送者用户姓名')}：</label>
					<div class="control-inline">
						<#form:input path="sendUserName" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('发送时间')}：</label>
					<div class="control-inline">
						<#form:input path="sendDate" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('是否合并推送')}：</label>
					<div class="control-inline">
						<#form:input path="isMergePush" maxlength="1" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('计划推送时间')}：</label>
					<div class="control-inline">
						<#form:input path="planPushDate" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('推送尝试次数')}：</label>
					<div class="control-inline">
						<#form:input path="pushNumber" maxlength="11" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('推送返回结果码')}：</label>
					<div class="control-inline">
						<#form:input path="pushReturnCode" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('推送返回消息编号')}：</label>
					<div class="control-inline">
						<#form:input path="pushReturnMsgId" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('推送返回的内容信息')}：</label>
					<div class="control-inline">
						<#form:input path="pushReturnContent" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('推送状态')}：</label>
					<div class="control-inline">
						<#form:input path="pushStatus" maxlength="1" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group hidden">
					<label class="control-label">${text('推送时间')}：</label>
					<div class="control-inline">
						<#form:input path="pushDate" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('读取状态')}：</label>
					<div class="control-inline">
						<#form:input path="readStatus" maxlength="1" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('读取时间')}：</label>
					<div class="control-inline">
						<#form:input path="readDate" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("消息类型")}', name:'msgType', index:'a.msg_type', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/zx/sys/msg/push/zxMsgPush/form?id='+row.id+'" class="btnList" data-title="${text("编辑消息推送表")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("消息标题")}', name:'msgTitle', index:'a.msg_title', width:150, align:"left"},
		{header:'${text("消息内容")}', hidden:true, name:'msgContent', index:'a.msg_content', width:150, align:"left"},
		{header:'${text("业务主键")}', hidden:true, name:'bizKey', index:'a.biz_key', width:150, align:"left"},
		{header:'${text("业务类型")}', hidden:true, name:'bizType', index:'a.biz_type', width:150, align:"left"},
		{header:'${text("接受者账号")}',hidden:true, name:'receiveCode', index:'a.receive_code', width:150, align:"left"},
		{header:'${text("接受者用户编码")}',hidden:true, name:'receiveUserCode', index:'a.receive_user_code', width:150, align:"left"},
		{header:'${text("接受者用户姓名")}', name:'receiveUserName', index:'a.receive_user_name', width:150, align:"left"},
		{header:'${text("发送者用户编码")}',hidden:true, name:'sendUserCode', index:'a.send_user_code', width:150, align:"left"},
		{header:'${text("发送者用户姓名")}',hidden:true, name:'sendUserName', index:'a.send_user_name', width:150, align:"left"},
		{header:'${text("发送时间")}', name:'sendDate', index:'a.send_date', width:150, align:"center"},
		{header:'${text("是否合并推送")}', hidden:true,name:'isMergePush', index:'a.is_merge_push', width:150, align:"left"},
		{header:'${text("计划推送时间")}', hidden:true,name:'planPushDate', index:'a.plan_push_date', width:150, align:"center"},
		{header:'${text("推送尝试次数")}', hidden:true,name:'pushNumber', index:'a.push_number', width:150, align:"center"},
		{header:'${text("推送返回结果码")}',hidden:true, name:'pushReturnCode', index:'a.push_return_code', width:150, align:"left"},
		{header:'${text("推送返回消息编号")}',hidden:true, name:'pushReturnMsgId', index:'a.push_return_msg_id', width:150, align:"left"},
		{header:'${text("推送返回的内容信息")}', hidden:true,name:'pushReturnContent', index:'a.push_return_content', width:150, align:"left"},
		{header:'${text("推送状态")}', name:'pushStatus', index:'a.push_status', width:150, align:"left"},
		{header:'${text("推送时间")}', name:'pushDate', index:'a.push_date', width:150, align:"center"},
		{header:'${text("读取状态")}', name:'readStatus', index:'a.read_status', width:150, align:"left"},
		{header:'${text("读取时间")}', name:'readDate', index:'a.read_date', width:150, align:"center"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('zx:sys:msg:push:zxMsgPush:edit')){ %>
				actions.push('<a href="${ctx}/zx/sys/msg/push/zxMsgPush/form?id='+row.id+'" class="btnList" title="${text("编辑消息推送表")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				if (row.status == Global.STATUS_NORMAL){
					actions.push('<a href="${ctx}/zx/sys/msg/push/zxMsgPush/disable?id='+row.id+'" class="btnList" title="${text("停用消息推送表")}" data-confirm="${text("确认要停用该消息推送表吗？")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
				} else if (row.status == Global.STATUS_DISABLE){
					actions.push('<a href="${ctx}/zx/sys/msg/push/zxMsgPush/enable?id='+row.id+'" class="btnList" title="${text("启用消息推送表")}" data-confirm="${text("确认要启用该消息推送表吗？")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
				}
				actions.push('<a href="${ctx}/zx/sys/msg/push/zxMsgPush/delete?id='+row.id+'" class="btnList" title="${text("删除消息推送表")}" data-confirm="${text("确认要删除该消息推送表吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>